<!-- 供应商认证记录 -->
<template>
  <div class="base-info"
    ><a-tabs default-active-key="1">
      <a-tab-pane key="1" title="样品认证">
        <SampleCertification :goodsdata="SampleData"></SampleCertification>
      </a-tab-pane>
      <a-tab-pane key="2" title="验厂认证">
        <FactoryCertification :data="FactoryData"></FactoryCertification>
      </a-tab-pane>
      <a-tab-pane key="3" title="样品试用认证">
        <SampleTrialCertification
          :data="SamplingData"
        ></SampleTrialCertification>
      </a-tab-pane>
    </a-tabs>
  </div>
</template>

<script lang="ts" setup>
  import { ref } from 'vue';
  import { useRoute } from 'vue-router';
  import { GetArchivesDetaliType } from '@/api/buy-management/archives-details/index';
  import FactoryCertification from './components/factory-certification/index.vue';
  import SampleCertification from './components/sample-certification/index.vue';
  import SampleTrialCertification from './components/sample-trial-certification/index.vue';

  const route = useRoute();
  const FactoryData = ref();
  const SampleData = ref();
  const SamplingData = ref();
  const getData = async () => {
    const res = await GetArchivesDetaliType({
      id: Number(route.query.id),
      typeId: 6,
    });
    FactoryData.value = res.filter((i) => i.authSetId === 2);
    SampleData.value = res.filter((i) => i.authSetId === 1);
    SamplingData.value = res.filter((i) => i.authSetId === 3);
  };
  getData();
</script>

<style scoped lang="less">
  .base-info {
    padding: 0 40px;
  }
</style>
